use dataset_candidates_house, clear

eststo clear
eststo: quietly reg qual_chall anyfrack i.year , a(groupid) cl(groupid)  
eststo: quietly reg qual_chall anyfrack i.year ///
	if districtpartisanship >= 0, a(groupid) cl(groupid)
eststo: quietly reg qual_chall anyfrack i.year ///
	if districtpartisanship < 0 , a(groupid) cl(groupid) 
eststo: quietly reg uncontested   anyfrack i.year, a(groupid) cl(groupid)

label variable anyfrack "Any wells"

#delimit;

esttab
	using "_output/tableA13.tex"
	,
		booktabs
		replace
		drop(*year* _cons)
		se
		compress
		mtitles(All D R " ")
		label
		mgroups(
			"Challenger Quality" 
			"Uncontested Race"
			"General Election CF Scores", 		 
			pattern(1 0 0 1)
			prefix(\multicolumn{@span}{c}{) suffix(})
			span erepeat(\cmidrule(lr){@span})
		)	
		nonote
		stats(N, label ("Observations") fmt(%20.0fc))
		;

#delimit cr
